<%--
  Created by IntelliJ IDEA.
  User: hysio
  Date: 2020/5/10
  Time: 16:56
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>软件测试工程师管理系统 - 查询工程师</title>
    <link rel="stylesheet" href="layui/css/layui.css">
</head>
<body class="layui-layout-body">

<%
    if(session.getAttribute("user") == null)
    {
        response.sendRedirect("login.jsp");
    }
%>

<div class="layui-layout layui-layout-admin">
    <div class="layui-header">
        <div class="layui-logo">软件测试工程师管理系统</div>
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <%=session.getAttribute("user")%>
                </a>
            </li>
            <li class="layui-nav-item"><a href="login.jsp">退出</a></li>
        </ul>
    </div>

    <div class="layui-side layui-bg-black">
        <div class="layui-side-scroll">
            <!-- 左侧导航区域（可配合layui已有的垂直导航） -->
            <ul class="layui-nav layui-nav-tree"  lay-filter="test">
                <li class="layui-nav-item"><a href="index.jsp">首页</a></li>
                <li class="layui-nav-item"><a href="insert.jsp">添加工程师</a></li>
                <li class="layui-nav-item"><a href="select.jsp">查询工程师</a></li>
                <li class="layui-nav-item"><a href="select.jsp">修改工程师</a></li>
                <li class="layui-nav-item"><a href="select.jsp">删除工程师</a></li>
                <li class="layui-nav-item"><a href="history.jsp">操作记录</a></li>
                <li class="layui-nav-item"><a href="calculate.jsp">薪水计算</a></li>
                <li class="layui-nav-item"><a href="sort.jsp">资料排序</a></li>
                <li class="layui-nav-item"><a href="empty.jsp">清空资料</a></li>
                <li class="layui-nav-item"><a href="print.jsp">打印报表</a></li>
            </ul>
        </div>
    </div>

    <div class="layui-body">
        <!-- 内容主体区域 -->
        <div class="layui-tab-item layui-show">
            <div class="layui-main">
                <fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
                    <legend>查询工程师</legend>
                </fieldset>
                <form class="layui-form layui-form-pane" action="/idea_project_war_exploded/Select" method="post" >
                    <div class="layui-form-item">
                        <label class="layui-form-label">查询方式</label>
                        <div class="layui-input-block">
                            <input type="radio" name="selectBy" lay-verify="required" value="ID" title="ID" checked="">
                            <input type="radio" name="selectBy" lay-verify="required" value="姓名" title="姓名">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">请输入</label>
                        <div class="layui-input-inline">
                            <input type="text" name="keyword" id = "keyword" lay-verify="required" autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label class="layui-form-label">精确查询</label>
                        <div class="layui-input-block">
                            <input type="checkbox" name="close" lay-skin="switch" lay-text="ON|OFF" value="on">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <div class="layui-input-block">
                            <button type="submit" class="layui-btn" lay-submit="" lay-filter="demo1">查找</button>
                        </div>
                    </div>

                </form>
            </div>
        </div>
    </div>

</div>
<script src="layui/layui.js" charset="utf-8"></script>
<script>
    layui.use('table', function() {
        var table = layui.table;

        table.render({
            elem: '#test'
            , url: '/idea_project_war_exploded/SearchByName'
            , toolbar: true
            , title: '用户数据表'
            , totalRow: true
            , cols: [[
                {field: 'id', title: 'ID', width: 80, fixed: 'left'}
                , {field: 'name', title: '用户名', width: 120, edit: 'text'}
                , {field: 'sex', title: '邮箱', width: 150, edit: 'text'}
                , {field: 'birthday', title: '积分', width: 100, totalRow: true}
                , {field: 'education', title: '性别', width: 80, edit: 'text'}
                , {field: 'native_place', title: '登入次数', width: 100, totalRow: true}
                , {field: 'place', title: '签名'}
                , {field: 'phone', title: '城市', width: 100}
                , {field: 'work_age', title: 'IP', width: 120}
                , {field: 'base_pay', title: '加入时间', width: 120}
            ]]
            , page: false
            , response: {
                statusCode: 200 //重新规定成功的状态码为 200，table 组件默认为 0
            }
            , parseData: function (res) { //将原始数据解析成 table 组件所规定的数据
                return {
                    "code": res.status, //解析接口状态
                    "msg": res.message, //解析提示文本
                    "count": res.total, //解析数据长度
                    "data": res.rows.item //解析数据列表
                };
            }
        });
    });
</script>
<script>
    //JavaScript代码区域
    layui.use('element', function(){
        var element = layui.element;

    });
</script>
</body>
</html>